import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Cinema {
    private static Cinema instance = new Cinema();
    private List<Hall> halls = new ArrayList<>();
    private List<Schedule> schedules = new ArrayList<>();
    private MovieManagementSystem movieManagementSystem = new MovieManagementSystem();
    private UserManagementSystem userManagementSystem = UserManagementSystem.getInstance();

    private Cinema() {
        this.movieManagementSystem = new MovieManagementSystem();
        this.userManagementSystem = UserManagementSystem.getInstance();
    }
    public static Cinema getInstance() {
        return instance;
    }

    public void initDefaultAdmin() {
        Admin admin = new Admin("admin", "yuninfo#777");
        userManagementSystem.registerUser(admin);
        System.out.println("默认管理员已初始化");
    }

    public void addHall(Hall hall) {
        halls.add(hall);
        System.out.println("放映厅 [" + hall.getName() + "] 已添加");
    }

    public void addSchedule(Schedule schedule) {
        schedules.add(schedule);
        System.out.println("排片 [" + schedule.getMovie().getName() + "] 已添加");
    }

    public List<Hall> getHalls() {

        return halls;
    }

    public List<Schedule> getSchedules() {
        return schedules;
    }

    public MovieManagementSystem getMovieManagementSystem() {
        return movieManagementSystem;
    }

    public UserManagementSystem getUserManagementSystem() {
        return userManagementSystem;
    }
}


